//
//  ChannelLabel.m
//  网易新闻
//
//  Created by Shenzhen_iOS_07 on 16/11/7.
//  Copyright © 2016年 Shenzhen_iOS_07. All rights reserved.
//

#import "SISSChannelLabel.h"

@implementation SISSChannelLabel

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        self.textAlignment = NSTextAlignmentCenter;
        self.font = [UIFont systemFontOfSize:16.0];
        
//        self.backgroundColor =  [UIColor colorWithRed:arc4random_uniform(256) / 255.0 green:arc4random_uniform(256) / 255.0 blue:arc4random_uniform(256) / 255.0 alpha:1.0];
    }
    
    return self;
}
    
- (void)setScale:(CGFloat)scale {
    // 外界传入的范围是0.000000 ~ 1.000000
    _scale = scale;
    
    self.textColor = scale > 0.5 ? MAIN_COLOR : MAIN_TEXT_COLOR;
    
    // 控件沿着X轴和Y轴同时进行缩放 : 两个参数最小值就是1.0;表示原始大小
//    self.transform = CGAffineTransformMakeScale(1.0, 1.0);
    
    // 确定最小缩放比
    CGFloat minScale = 1.0;
    // 确定最大缩放比
    CGFloat maxScale = 1.3;
    
//    scale = 1.0 + 0.3 * scale;
    scale = minScale + (maxScale - minScale) * scale;
    
//    self.transform = CGAffineTransformMakeScale(scale, scale);
}
    
@end
